<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Corrales y Vias</title>

<script type="text/javascript">

window.onload = function() {
document.getElementById('fe2').onchange = disablefield;
document.getElementById('fe1').onchange = disablefield;
}

function disablefield()
{
if ( document.getElementById('fe2').checked == true ){
document.getElementById('ssc').value = "";
document.getElementById('ssc').disabled = true}
else if (document.getElementById('fe1').checked == true ){
document.getElementById('ssc').disabled = false;}
}

</script>

</head>

<body>

<form name="frm" action='CorralesYVias.php' method='POST'>

<body>
<h2>Corral de la Finca</h2>

<h4>Techo el Corral</h4> <input type="radio" name="ferti" value="1" id="fe1" >SI <td><input type="text" name="ssc" id="ssc" > </td> <br> 

<input type="radio" name="ferti" value="2" id="fe2">NO </td> <br> 

<br />

Area del Corral <td><input type="text" name="cor" id="cor" > </td> <br> 
<br />

<input type='submit' name="Seleccionar"value='Selec' /><BR>
 </form>
 
 

<br /> <br />



<form name="frm" action='CorralesYVias.php' method='POST'>

<body>
<h2>Descripcion de Vias de Acceso</h2> 


<br />
<h4>Fluido Electrico</h4>

<input type="radio" name="ferti" value="1" id="fe1" >SI  <br> 

<input type="radio" name="ferti" value="2" id="fe2">NO </td> <br> 

<br />


Descripcion de las Vias <td><textarea rows="6" cols="30" name="cor"></textarea> </td> <br> 
<br />

<input type='submit' name="Seleccionar"value='Selec' /><BR>
 </form>



</body>
</html>

<?php
$server = "localhost";
$user = "Magsi";
$pass = "Magsi"; //depende de tu pass de mysql 

$conexion = mysql_connect($server, $user, $pass);
$db = mysql_select_db("magsi_db", $conexion);

$ferti = $_POST['ferti'];
$ssc= $_POST['ssc'];
$cor= $_POST['cor'];

$consulta = "insert into ma_af_corralfi(MA_Ti_OpcContiene, MA_Dc_TamaTecho, MA_Dc_TamaCorral) values ('.$ferti','.$ssc', '.$cor')";

$result = mysql_query($consulta, $conexion);


?>


<?php
$server = "localhost";
$user = "Magsi";
$pass = "Magsi"; //depende de tu pass de mysql 

$conexion = mysql_connect($server, $user, $pass);
$db = mysql_select_db("magsi_db", $conexion);

$cor= $_POST['cor'];
$ferti = $_POST['ferti'];


$consulta = "insert into ma_af_accesofi(MA_V_DescAccesoFi, MA_TI_OpcElectric ) values ( '$cor', '$ferti')";

$result = mysql_query($consulta, $conexion);


?>

